package nba2kmodtool.filedesc;

import java.io.File;
import java.io.IOException;

/**
 * IFF File 工厂类
 * @author JemiZhuu
 * @category IffFactory
 * @version 1.0
 * @since 2010-12-21
 */
public class IffFactory {
	/**
	 * Read IFF File
	 * @param file
	 * @param version
	 * @return
	 * @throws IOException
	 */
	public static BaseIffFile readIffFile(File file, int version) throws IOException {
		switch (version) {
		case 2009: {
			return new nba2kmodtool.filedesc.v2009.IffFile(file);
		}
		case 2010: {
			return new nba2kmodtool.filedesc.v2010.IffFile(file);
		}
		case 2011: {
			return new nba2kmodtool.filedesc.v2011.IffFile(file);
		}
		case 2012: {
			return new nba2kmodtool.filedesc.v2012.IffFile(file);
		}
		default:
			throw new IOException("Unkown Iff File version: " + version);
		}
	}
}
